﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Materials.RecipientsToAppls;
using Volo.Abp.Application.Services;

namespace TianShiProject.Materials.RecipientsToAppls
{
    public class RecipientsToApplsService : ApplicationService
    {
        private readonly IRecipientsToApplsRepository _recipientsToApplsRepository;
        public RecipientsToApplsService(IRecipientsToApplsRepository recipientsToApplsRepository)
        {
            _recipientsToApplsRepository = recipientsToApplsRepository;
        }

        #region 物资领用——查询分页显示
        /// <summary>
        /// 物资领用——查询分页显示
        /// </summary>
        /// <param name="Recipient"></param>
        /// <param name="ReceiveTimek"></param>
        /// <param name="ApprovalStatusk"></param>
        /// <param name="Approverk"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<RecipientsToApplsDto>> GetRecipientsToApplsPageShow(string Recipient, DateTime? ReceiveTimek, int ApprovalStatusk, string Approverk, int pageindex = 1, int pagesize = 3)
        {
            return await _recipientsToApplsRepository.GetRecipientsToApplsPageShow(Recipient, ReceiveTimek, ApprovalStatusk, Approverk, pageindex, pagesize);
        }
        #endregion

        #region 物资领用——逻辑删除
        /// <summary>
        /// 物资领用——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeleteRecipientsToAppls(int id)
        {
            return await _recipientsToApplsRepository.DeleteRecipientsToAppls(id);
        }
        #endregion

        #region 物资领用——批量删除
        /// <summary>
        /// 物资领用——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<int> DeleteBatchRecipientsToAppls(string ids)
        {
            return await _recipientsToApplsRepository.DeleteBatchRecipientsToAppls(ids);
        }
        #endregion

        #region 物资领用——编辑
        /// <summary>
        /// 物资领用——编辑
        /// </summary>
        /// <param name="purchaseRequestDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateRecipientsToAppls(RecipientsToApplsDto recipientsToApplsDto)
        {
            return await _recipientsToApplsRepository.PutUpdateRecipientsToAppls(recipientsToApplsDto);
        }
        #endregion

        #region 物资领用——添加
        /// <summary>
        /// 物资领用——添加
        /// </summary>
        /// <param name="purchaseRequestDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddRecipientsToAppls(RecipientsToApplsDto recipientsToApplsDto)
        {
            return await _recipientsToApplsRepository.PostAddRecipientsToAppls(recipientsToApplsDto);
        }
        #endregion
    }
}
